package com.hxkj.controller.http;

import com.hxkj.domain.po.VisualBean;
import com.hxkj.service.http.VisualizationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.ModelAttribute;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * @ClassName VisualizationController
 * @Author yaosy
 * @Date 2018年8月16日13:42:04
 * @Version 1.0
 */
@RestController
@RequestMapping("/visualization")
public class VisualizationController {

    @Autowired
    private VisualizationService visualizationService;

    /**
     * @Description 动态解析模板;适用于可视化窗口
     * @Date yaosy
     **/
    @RequestMapping(value = "/resolve")
    public void resolve(@ModelAttribute VisualBean visualBean, HttpServletRequest request , HttpServletResponse response) throws Exception{
        visualizationService.resolve(visualBean,request,response);
    }


    /**
     * @Description 替换旧模板
     * @Date yaosy
     **/
    @RequestMapping(value = "/replace")
    public void resolve(@ModelAttribute VisualBean visualBean) throws Exception{
        visualizationService.replace(visualBean);
    }



}
